/*
 * (C) 2014-2015 Alibaba Group Holding Limited
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *
 *     __  ___   ______        ___       __          ___
 *    |  |/  /  /  __  \      /   \     |  |        /   \
 *    |  '  /  |  |  |  |    /  ^  \    |  |       /  ^  \
 *    |    <   |  |  |  |   /  /_\  \   |  |      /  /_\  \
 *    |  .  \  |  `--'  |  /  _____  \  |  `----./  _____  \
 *    |__|\__\  \______/  /__/     \__\ |_______/__/     \__\
 *
 *
 *
 */
//
// Created by KOALA TEAM on 12/19/14.
//

#import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>

#if DEBUG  //DEBUG

static const int ddLogLevel = LOG_LEVEL_VERBOSE;// 定义日志级别
#else

static const int ddLogLevel = LOG_LEVEL_ERROR;// 定义日志级别

#endif //DEBUG

@interface KLLogConfiguration : NSObject

+ (void)enableColor:(BOOL)enable;
+ (void)addLogger:(id <DDLogger>)logger;
+ (void)removeLogger:(id <DDLogger>)logger;
+ (void)removeAllLoggers;

@end

#define KLLogError      DDLogError
#define KLLogWarn       DDLogWarn
#define KLLogInfo       DDLogInfo
#define KLLogVerbose    DDLogVerbose

#ifndef DEBUG
#define NSLog
#endif

#define GetTickCount() CFAbsoluteTimeGetCurrent()

#define TIME_START \
__block double tickcount = GetTickCount();
#define LOG_TIME(_msg_) {KLLogInfo(@"%s(%d) %@  time:%.4fs",__FUNCTION__,__LINE__,_msg_,GetTickCount()-tickcount);tickcount = GetTickCount();}

#define LOG_TIMEC(_msg_) {KLLogInfo(@"%s(%d) %@  time:%.4fs",__FUNCTION__,__LINE__,_msg_,GetTickCount()-tickcount);tickcount = GetTickCount();}